public class MinStack {
    Stack<Integer> s1;
    Stack<Integer> s2;
    /** initialize your data structure here. */
    public MinStack() {
        s1 = new Stack(); // 普通栈
        s2 = new Stack(); // 递减栈，栈顶元素一定是最小的
    }

    public void push(int x) {
        s1.push(x);
        if (s2.isEmpty() || s2.peek() >= x) s2.push(x);
    }

    public void pop() {
        Integer pop = s1.pop();
        if (pop.equals(s2.peek())) s2.pop();
    }

    public int top() {
        return s1.peek();
    }

    public int min() {
        return s2.peek();
    }
}
// push4 6 3 1 10
// s1  
// s2 